#ifndef __MARS_GP_CONTEXT_H__
#define __MARS_GP_CONTEXT_H__

#include "MarsObject.h"
#include "MarsSharedPtr.h"
#include "MarsWeakPtr.h"
#include "MarsGPDevice.h"

namespace GP
{

class CommandQueue;
	
class Context : public Object, public RefCountObject
{
public:
									Context( const DevicePtr& device );
	virtual							~Context();

	const DevicePtr&				GetDevice() const;

protected:
	virtual bool					Create() = 0;

	DevicePtr						m_device;
	bool							m_bInit;
	CommandQueue*					m_pCommandQueue;
};

inline Context::Context( const DevicePtr& device )
	: m_device( device )
	, m_bInit( false )
{

}

inline Context::~Context()
{

}

inline const DevicePtr& Context::GetDevice() const
{
	return m_device;
}

typedef SharedPtr< Context >	ContextPtr;
typedef WeakPtr< Context >		ContextRef;

} // end of namespace GP

#endif // end of #ifndef __MARS_GP_CONTEXT_H__